﻿using Shop.RemoteModel.ActivityDiscount;
using Shop.RemoteModel.ActivityDiscount.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class ActivityDiscountEvent : IRpcApiService
    {
        private readonly IActivityDiscountService _Service;

        public ActivityDiscountEvent (IActivityDiscountService service)
        {
            this._Service = service;
        }

        public void SetActivityDiscount (SetActivityDiscount obj)
        {
            this._Service.Sync(obj.ActivityId, obj.Discount);
        }
        public DiscountSet GetActivityDiscount (GetActivityDiscount obj)
        {
            return this._Service.Get(obj.ActivityId);
        }
    }
}
